package com.chenfan.magic.feign.fallback;

import com.chenfan.common.vo.Response;
import com.chenfan.magic.entity.DataGroupDto;
import com.chenfan.magic.entity.SPrivilegeRes;
import com.chenfan.magic.feign.PrivilegeServer;
import com.chenfan.privilege.request.SRoleVOReq;
import com.chenfan.privilege.request.SUserVOReq;
import com.chenfan.privilege.response.SRoleVORes;
import com.chenfan.privilege.response.SUserVORes;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author liuming
 * @date 2021-03-22 17:01
 */
@Component
public class PrivilegeServerFallback implements FallbackFactory<PrivilegeServer> {
    @Override
    public PrivilegeServer create(Throwable throwable) {
        return new PrivilegeServer() {

            @Override
            public Response<List<SUserVORes>> listUsers(SUserVOReq userVOReq) {
                return null;
            }

            @Override
            public Response<List<SPrivilegeRes>> getListByCode(String code) {
                return null;
            }

            @Override
            public Response<SUserVORes> getUserInfo(SUserVOReq userVOReq) {
                return null;
            }

            @Override
            public Response<List<SRoleVORes>> listRoles(SRoleVOReq roleReq) {
                return null;
            }

            @Override
            public Response<List<SRoleVORes>> getUsersByRoleCode(SRoleVOReq roleReq) {
                return null;
            }

            @Override
            public Response<List<Long>> getTenantIdList() {
                return null;
            }

            @Override
            public Response getUserResources(String token, String appKey) {
                return null;
            }

            @Override
            public Response<List<DataGroupDto>> listByAppId(String token, String appKey) {
                return null;
            }
        };
    }
}
